import com.jfinal.json.FastJson;
import org.junit.Test;

import java.text.DecimalFormat;
import java.util.Map;

/**
 * @authc yaowk
 * 2017/6/16
 */
public class Index {

    @Test
    public void pay() {
        PayService payService = new PayService();
        Map result = payService.sendPay("3000", 1);
        sout(result);
    }

    @Test
    public void orderQuery() {
        PayService payService = new PayService();
        Map result = payService.orderQuery();
        sout(result);
    }

    @Test
    public void testDouble() {
        Double money = Double.valueOf(" -3.1552 ");
        DecimalFormat decimalFormat = new DecimalFormat("#.00");
        System.out.println(decimalFormat.format(money));
    }

    private void sout(Map map) {
        System.out.println(FastJson.getJson().toJson(map));
    }
}
